#!/usr/bin/python
# coding:utf-8
__author__ = 'good'
__createday__ = '2015-01-12'

from flask import Blueprint
from . import homes, search, upload

main = Blueprint('main', __name__, url_prefix='/')

main.add_url_rule('', view_func=homes.index, methods=['GET', 'POST'])
main.add_url_rule('index', view_func=homes.index, methods=['GET', 'POST'])
main.add_url_rule('<string:categoryname>/<string:month>/<int:page>',
                  view_func=homes.index,
                  methods=['GET', 'POST'])
main.add_url_rule('search', view_func=search.search, methods=['GET', 'POST'])
main.add_url_rule('uploads/<string:filename>', view_func=upload.uploaded_file)
main.add_url_rule('search_result/<string:sch>/<int:page>', view_func=search.search_result)
main.add_url_rule('upload', view_func=upload.upload, methods=['GET', 'POST'])
main.add_url_rule('msg', view_func=homes.msg, methods=['GET', 'POST'])
main.add_url_rule('about', view_func=homes.about)
main.add_url_rule('calendar', view_func=homes.calendar)
main.add_url_rule('favicon.ico', view_func=upload.favicon_ico)
main.add_url_rule('robot.txt', view_func=upload.robot_txt)
